package com.bupt.kgplatform.config;

import io.minio.MinioClient;
import io.minio.errors.InvalidEndpointException;
import io.minio.errors.InvalidPortException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName:MinioConfiguration
 * Package:com.example.blackjavaweb.config
 * Description:
 *
 * @Author QIQI_1999
 * @Creat 2023/10/14 19:03
 * @Version 1.0
 */

@Configuration
public class MinioConfiguration {
    @Autowired
    private MinioProperties minioProp;

    @Bean
    public MinioClient minioClient() throws InvalidPortException, InvalidEndpointException {
        MinioClient client = new MinioClient(minioProp.getEndpoint(), minioProp.getAccessKey(), minioProp.getSecretKey());
        return client;
    }
}
